package com.fusuhai02;

public class B extends A {
    int d;
    public int add(){
        System.out.println("在子类B的方法里");
        return d;
    }

    public B(int d) {
        this.d = d;
    }

    @Override
    public void methodA (){
        System.out.println("我是你爹");
        return;
    }

    public static void main(String[] args) {
        B b1 = new B(2);
        A b2 = new A(1,2);
        System.out.println(b1.d);
        b1.methodA();
        b2.methodA();
    }
}
